/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 17 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "MaCI_Player_GUI.h"

///////////////////////////////////////////////////////////////////////////

MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	m_menubar1 = new wxMenuBar( 0 );
	m_menu_file = new wxMenu();
	wxMenuItem* m_menuItem1;
	m_menuItem1 = new wxMenuItem( m_menu_file, wxID_ANY, wxString( wxT("&Load log files") ) , wxEmptyString, wxITEM_NORMAL );
	m_menu_file->Append( m_menuItem1 );
	
	wxMenuItem* m_menuItem2;
	m_menuItem2 = new wxMenuItem( m_menu_file, wxID_ANY, wxString( wxT("&Quit") ) , wxEmptyString, wxITEM_NORMAL );
	m_menu_file->Append( m_menuItem2 );
	
	m_menubar1->Append( m_menu_file, wxT("&File") );
	
	m_menu3 = new wxMenu();
	wxMenuItem* m_menuItem4;
	m_menuItem4 = new wxMenuItem( m_menu3, wxID_ANY, wxString( wxT("MaCI Group name") ) , wxEmptyString, wxITEM_NORMAL );
	m_menu3->Append( m_menuItem4 );
	
	m_menubar1->Append( m_menu3, wxT("&Set") );
	
	m_menu2 = new wxMenu();
	wxMenuItem* m_menuItem3;
	m_menuItem3 = new wxMenuItem( m_menu2, wxID_ANY, wxString( wxT("About") ) , wxEmptyString, wxITEM_NORMAL );
	m_menu2->Append( m_menuItem3 );
	
	m_menubar1->Append( m_menu2, wxT("&Help") );
	
	this->SetMenuBar( m_menubar1 );
	
	wxBoxSizer* bSizer1;
	bSizer1 = new wxBoxSizer( wxVERTICAL );
	
	wxBoxSizer* bSizer2;
	bSizer2 = new wxBoxSizer( wxVERTICAL );
	
	m_listCtrl_Services = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT );
	bSizer2->Add( m_listCtrl_Services, 1, wxALL|wxEXPAND, 5 );
	
	bSizer1->Add( bSizer2, 1, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer3;
	bSizer3 = new wxBoxSizer( wxHORIZONTAL );
	
	m_slider_time = new wxSlider( this, wxID_ANY, 0, 0, 1000, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_RIGHT );
	bSizer3->Add( m_slider_time, 1, wxALL|wxEXPAND, 5 );
	
	bSizer1->Add( bSizer3, 0, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer4;
	bSizer4 = new wxBoxSizer( wxHORIZONTAL );
	
	m_bpButton_Play = new wxBitmapButton( this, wxID_ANY, wxBitmap( wxT("images/play.bmp"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxSize( 30,30 ), wxBU_AUTODRAW );
	m_bpButton_Play->SetToolTip( wxT("Play/Pause") );
	
	m_bpButton_Play->SetToolTip( wxT("Play/Pause") );
	
	bSizer4->Add( m_bpButton_Play, 0, wxALL, 5 );
	
	m_bpButton_Stop = new wxBitmapButton( this, wxID_ANY, wxBitmap( wxT("images/stop.bmp"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxSize( 30,30 ), wxBU_AUTODRAW );
	m_bpButton_Stop->SetToolTip( wxT("Stop") );
	
	m_bpButton_Stop->SetToolTip( wxT("Stop") );
	
	bSizer4->Add( m_bpButton_Stop, 0, wxALL, 5 );
	
	m_bpButton_PlaySlower = new wxBitmapButton( this, wxID_ANY, wxBitmap( wxT("images/backward.bmp"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxSize( 30,30 ), wxBU_AUTODRAW );
	m_bpButton_PlaySlower->SetToolTip( wxT("Play slower") );
	
	m_bpButton_PlaySlower->SetToolTip( wxT("Play slower") );
	
	bSizer4->Add( m_bpButton_PlaySlower, 0, wxALL, 5 );
	
	m_bpButton_PlayFaster = new wxBitmapButton( this, wxID_ANY, wxBitmap( wxT("images/forward.bmp"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxSize( 30,30 ), wxBU_AUTODRAW );
	m_bpButton_PlayFaster->SetToolTip( wxT("Play faster") );
	
	m_bpButton_PlayFaster->SetToolTip( wxT("Play faster") );
	
	bSizer4->Add( m_bpButton_PlayFaster, 0, wxALL, 5 );
	
	
	bSizer4->Add( 0, 0, 1, wxEXPAND, 5 );
	
	m_bpButton_Repeat = new wxBitmapButton( this, wxID_ANY, wxBitmap( wxT("images/playOneTime.bmp"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxSize( 30,30 ), wxBU_AUTODRAW );
	m_bpButton_Repeat->SetToolTip( wxT("Play once/Repeat") );
	
	m_bpButton_Repeat->SetToolTip( wxT("Play once/Repeat") );
	
	bSizer4->Add( m_bpButton_Repeat, 0, wxALL, 5 );
	
	m_staticText_currentTime = new wxStaticText( this, wxID_ANY, wxT("0:00"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText_currentTime->Wrap( -1 );
	bSizer4->Add( m_staticText_currentTime, 0, wxALIGN_RIGHT|wxALL, 5 );
	
	m_staticText15 = new wxStaticText( this, wxID_ANY, wxT("/"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText15->Wrap( -1 );
	bSizer4->Add( m_staticText15, 0, wxALIGN_LEFT|wxALL, 5 );
	
	m_staticText_totalTime = new wxStaticText( this, wxID_ANY, wxT("0:00"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText_totalTime->Wrap( -1 );
	bSizer4->Add( m_staticText_totalTime, 0, wxALIGN_RIGHT|wxALL, 5 );
	
	bSizer1->Add( bSizer4, 0, wxEXPAND, 5 );
	
	this->SetSizer( bSizer1 );
	this->Layout();
	m_statusBar1 = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY );
	
	// Connect Events
	this->Connect( m_menuItem1->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnLoadLogFile ) );
	this->Connect( m_menuItem2->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnQuit ) );
	this->Connect( m_menuItem4->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnSetMaCIGroupName ) );
	this->Connect( m_menuItem3->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnAbout ) );
	m_listCtrl_Services->Connect( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEventHandler( MainFrame::OnListItemRClick ), NULL, this );
	m_listCtrl_Services->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( MainFrame::OnListItemSelected ), NULL, this );
	m_slider_time->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_bpButton_Play->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnPlayButtonClick ), NULL, this );
	m_bpButton_Stop->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnStopButtonClick ), NULL, this );
	m_bpButton_PlaySlower->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnSlowerButtonClick ), NULL, this );
	m_bpButton_PlayFaster->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnFasterButtonClick ), NULL, this );
	m_bpButton_Repeat->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnRepeatButtonClick ), NULL, this );
}

MainFrame::~MainFrame()
{
	// Disconnect Events
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnLoadLogFile ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnQuit ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnSetMaCIGroupName ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnAbout ) );
	m_listCtrl_Services->Disconnect( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEventHandler( MainFrame::OnListItemRClick ), NULL, this );
	m_listCtrl_Services->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( MainFrame::OnListItemSelected ), NULL, this );
	m_slider_time->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Disconnect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Disconnect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Disconnect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_slider_time->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( MainFrame::OnSliderScroll ), NULL, this );
	m_bpButton_Play->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnPlayButtonClick ), NULL, this );
	m_bpButton_Stop->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnStopButtonClick ), NULL, this );
	m_bpButton_PlaySlower->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnSlowerButtonClick ), NULL, this );
	m_bpButton_PlayFaster->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnFasterButtonClick ), NULL, this );
	m_bpButton_Repeat->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnRepeatButtonClick ), NULL, this );
}

About_Dialog::About_Dialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer15;
	bSizer15 = new wxBoxSizer( wxVERTICAL );
	
	m_staticText3 = new wxStaticText( this, wxID_ANY, wxT("MaCI Player - Gimbo Component"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText3->Wrap( -1 );
	m_staticText3->SetFont( wxFont( 16, 70, 90, 92, false, wxEmptyString ) );
	
	bSizer15->Add( m_staticText3, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_staticText_Version = new wxStaticText( this, wxID_ANY, wxT("Version 0.01 beta"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText_Version->Wrap( -1 );
	bSizer15->Add( m_staticText_Version, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_staticText5 = new wxStaticText( this, wxID_ANY, wxT("by"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText5->Wrap( -1 );
	bSizer15->Add( m_staticText5, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_staticText6 = new wxStaticText( this, wxID_ANY, wxT("Matthieu Myrsky <matthieu.myrsky@tkk.fi>"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText6->Wrap( -1 );
	m_staticText6->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
	
	bSizer15->Add( m_staticText6, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	bSizer15->Add( m_staticline3, 0, wxEXPAND | wxALL, 5 );
	
	m_staticText9 = new wxStaticText( this, wxID_ANY, wxT("Available players"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText9->Wrap( -1 );
	m_staticText9->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
	
	bSizer15->Add( m_staticText9, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_staticText16 = new wxStaticText( this, wxID_ANY, wxT("MaCI_CoordinateDrive from logged file"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText16->Wrap( -1 );
	bSizer15->Add( m_staticText16, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_staticText13 = new wxStaticText( this, wxID_ANY, wxT("MaCI_Energy from logged file"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText13->Wrap( -1 );
	bSizer15->Add( m_staticText13, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_staticText17 = new wxStaticText( this, wxID_ANY, wxT("MaCI_IMU from logged file"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText17->Wrap( -1 );
	bSizer15->Add( m_staticText17, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_staticText10 = new wxStaticText( this, wxID_ANY, wxT("MaCI_Position from logged file"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText10->Wrap( -1 );
	bSizer15->Add( m_staticText10, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_staticText11 = new wxStaticText( this, wxID_ANY, wxT("MaCI_Ranging from logged file"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText11->Wrap( -1 );
	bSizer15->Add( m_staticText11, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_staticText12 = new wxStaticText( this, wxID_ANY, wxT("MaCI_SpeedCtrl from logged file"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText12->Wrap( -1 );
	bSizer15->Add( m_staticText12, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_staticText14 = new wxStaticText( this, wxID_ANY, wxT("MaCI_Wireless from logged file"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText14->Wrap( -1 );
	bSizer15->Add( m_staticText14, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_staticText141 = new wxStaticText( this, wxID_ANY, wxT("MaCI_Image from logged file"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText141->Wrap( -1 );
	bSizer15->Add( m_staticText141, 0, wxALIGN_CENTER|wxALL, 5 );
	
	
	bSizer15->Add( 0, 20, 1, wxEXPAND, 5 );
	
	m_button8 = new wxButton( this, wxID_ANY, wxT("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer15->Add( m_button8, 0, wxALIGN_CENTER|wxALL, 5 );
	
	this->SetSizer( bSizer15 );
	this->Layout();
	bSizer15->Fit( this );
	
	// Connect Events
	m_button8->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( About_Dialog::OnOk ), NULL, this );
}

About_Dialog::~About_Dialog()
{
	// Disconnect Events
	m_button8->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( About_Dialog::OnOk ), NULL, this );
}

Get_Name::Get_Name( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer6;
	bSizer6 = new wxBoxSizer( wxVERTICAL );
	
	m_staticText_Question = new wxStaticText( this, wxID_ANY, wxT("Enter MaCI Group Name"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText_Question->Wrap( -1 );
	bSizer6->Add( m_staticText_Question, 0, wxALL, 5 );
	
	m_textCtrl_Text = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	bSizer6->Add( m_textCtrl_Text, 0, wxALL|wxEXPAND, 5 );
	
	wxBoxSizer* bSizer7;
	bSizer7 = new wxBoxSizer( wxHORIZONTAL );
	
	m_button2 = new wxButton( this, wxID_ANY, wxT("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer7->Add( m_button2, 0, wxALL, 5 );
	
	m_button3 = new wxButton( this, wxID_ANY, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer7->Add( m_button3, 0, wxALL, 5 );
	
	bSizer6->Add( bSizer7, 1, wxALIGN_CENTER, 5 );
	
	this->SetSizer( bSizer6 );
	this->Layout();
	
	// Connect Events
	m_button2->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Get_Name::OnOk ), NULL, this );
	m_button3->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Get_Name::OnCancel ), NULL, this );
}

Get_Name::~Get_Name()
{
	// Disconnect Events
	m_button2->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Get_Name::OnOk ), NULL, this );
	m_button3->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Get_Name::OnCancel ), NULL, this );
}
